
namespace CloudNinja.Metering.Web
{
    using System;
    using System.Diagnostics;

    using CloudNinja.Metering.TypeRegistration;

    using Microsoft.WindowsAzure.ServiceRuntime;

    public class WebRole : RoleEntryPoint
    {
        private Metering metering;

        public override void Run()
        {
            //if (!RoleEnvironment.IsEmulated)
            //{
                try
                {
                    this.metering = MeteringContainer.GetMetering();

                    this.metering.Start();
                }
                catch (Exception ex)
                {
                    Trace.TraceError("Error initializing Metering block", ex);
                }
            //}

            base.Run();
        }
    }
}
